#include<iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <set>
#include <map>
using namespace std;
class Solution {
public:
    vector<vector<string>> groupAnagrams(vector<string>& strs) {
        map<string, int>m;
        vector<string> vt;
        vector<vector<string>> ans;
        for (int i = 0; i < strs.size(); i++)
        {
            string str = strs[i];
            string t = "                           ";
            for (int j = 0; j < str.length(); j++)
            {
                int c = str[j] - 'a';
                t[c]++;
            }
            if (!m.count(t))
            {
                m[t] = ans.size();
                ans.push_back(vt);
            }
            ans[m[t]].push_back(str);
        }
        return ans;
    }
};
int main()
{
    Solution s;

}